# coding = utf-8

def bulk(self):
    print("%s is drinking..." % self.name)


tianqi = "39C"


class Dog(object):

    def __init__(self, name):
        self.name = name

    def eat(self, food):
        print("%s is eating %s" % (self.name, food))

    def bueat(self, food):
        print("%s is nononononono %s" % (self.name, food))


d = Dog("liuzhiqiang")
choice = input(">>:").strip()


# setattr(d, choice, bulk)
# d.talk(d)


if hasattr(d, choice):
    func = getattr(d, choice)
    func("hahahahahahahaha")
else:
    # # 第三位是方法的话，返回的是内存地址，需要带括号传自己才行
    # setattr(d, choice, bulk)
    # d.talk(d)
    # 第三位是静态属性的话，返回的是值
    setattr(d, choice, tianqi)
    print(getattr(d, choice))





